<?php
require_once(ROOTDIR."/include/database/class.UserQueries.php");

$userQueries = new UserQueries();
$users = $userQueries->getUsers();

echo "\"clanMembers\"\n";
echo "{\n";

// Cycle through each user and create the keygroup
foreach($users as $user) {

  $admin = 0;
  echo "  \"".$user->getSteamId()."\"\n";
  echo "  {\n";
  // Determine if the user has "admin" privileges
  // 4 is member only
  if($user->getAccessLevel() == 4) {
    $admin = 0;
  } else {
    $admin = 1;
  }
  
  echo "    \"name\"      \"".$user->getName()."\"\n";
  echo "    \"member\"    \"1\"\n";
  echo "    \"admin\"     \"".$admin."\"\n";

  echo "  }\n";
}
?>
}